class Solution(object):
    def intersection(self, nums1, nums2):
        """
        :type nums1: List[int]
        :type nums2: List[int]
        :rtype: List[int]
        """
        def binarySearch(nums, target):
            l = 0
            h = len(nums) - 1
            while l <= h:
                m = l + (h - l) / 2
                if nums[m] == target:
                    return True
                if nums[m] < target:
                    l = m + 1
                else:
                    h = m - 1
            return False

        sorted_nums2 = sorted(nums2)
        inter_set = set()
        for i in nums1:
            if binarySearch(sorted_nums2, i):
                inter_set.add(i)
        return list(inter_set)

